// import Mock from 'mockjs'
import { builder, userNav } from './mockUtils'
import { defineMock } from 'vite-plugin-mock-dev-server'
// id: "@id",
// number: "@int(5,9)",
// name: "@name",
// cname: "@cname",
// date: "@dateTime",
// reg: /\w{10}/,

export default defineMock([
/*
  {
    url: '/api/safeStock/search',
    method: 'POST',
    response(req, res, next) {

      let arr= []
      for (let i = 0; i < 12; i++) {
        arr.push({
          id: i+1,
          creator: 2,
          creationDate: '2024-09-05T20:27:45.000+00:00',
          lsdModifier: null,
          modifiedDate: null,
          warehouseName: '2',
          warehouseCode: '2',
          workStation: '2',
          safeStockNum: 2,
          materialCode: '2',
          materialName: '2',
          unit: '',
          creatorDisplay: 'admin',
          lsdModifierDisplay: null
        })

      }
      const data = {
        message: '',
        data: {
          total: 12,
          totalPages: 2,
          pageIndex: 1,
          pageSize: 10,
          dataList: arr
        },
        code: 200
      }
      res.end(JSON.stringify(data))
    }
  },
*/

  {
    url: '/auth/logout',
    method: 'GET',
    body() {
      return builder({}, '[测试接口] 注销成功1')
    }
  },
  {
    url: '/auth/unlock',
    method: 'POST',
    body() {
      return { unlocked: true }
    }
  }
])
